Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: Adds new FEXpidof tool #3365

Merged
merged 1 commit into from
Jan 15, 2024
Merged

Conversation

Sonicadvance1
Copy link
Member

This behaves exactly like pidof but only searches for FEX applications. This fixes a long standing annoyance of mine that pidof doesn't work for FEX. This behaves exactly like pidof but knows how to decode the command line options to pull out the program data.

If the Linux kernel ever accepts the patches for binfmt_misc to change how the interpreter is handled then this will become redundant, but until that happens here is a utility that I want.

@Amanieu
Copy link

Amanieu commented Jan 11, 2024

Alternatively you could use prctl(PR_SET_MM_MAP) and prctl(PR_SET_NAME) to ensure /proc/PID/cmdline and /proc/PID/comm contain the expected data for translated processes.

Copy link
Member

@neobrain neobrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the suggested use of prctl can make pidof work with FEX applications, that sounds preferable over shipping our own tools, but if not this looks good as well.

This behaves exactly like pidof but only searches for FEX applications.
This fixes a long standing annoyance of mine that pidof doesn't work for
FEX. This behaves exactly like pidof but knows how to decode the command
line options to pull out the program data.

If the Linux kernel ever accepts the patches for binfmt_misc to change
how the interpreter is handled then this will become redundant, but
until that happens here is a utility that I want.
@Sonicadvance1 Sonicadvance1 merged commit be4d1a8 into FEX-Emu:main Jan 15, 2024
10 checks passed
@Sonicadvance1 Sonicadvance1 deleted the pidof branch January 15, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants